import request from '@/utils/request'

export default {
    addChapterShow(chapter){
        return request({
            url: `/courseManagment/addChapter`,
            method: 'post',
           data:chapter
        })
    },
    
    ChapterListShow() {
        return request({
            url: `/courseManagment/getChapter`,
            method: 'post',
           
        })
    },
    //获取课程管理分页列表
    getHeadlineShowListPage(page,limit,headlineShowQuery) {
        return request({
            url: `/courseManagment/selectAll`,
            method: 'post',
            data: {
                page:page,
                limit:limit,
                name:headlineShowQuery.name,
                upTime:headlineShowQuery.startTime,
                timeLimit:headlineShowQuery.endTime,
                stateOfCourse:headlineShowQuery.stateOfCourse
            }
        })
    },
    //移除课程管理到回收站或者删除
    deleteOne(ids) {
        return request({
            url: `/courseManagment/deleteOne`,
            method: 'post',
            data: {
                ids:[ids]
            }
        })
    },
    addCoursesShow(addData){
        return request({
            url:`/courseManagment/addOne`,
            method:'post',
            data:addData
        })
    },
    updateCoursesShow(addData){
        return request({
            url:`/courseManagment/updateOne`,
            method:'post',
            data:addData
        })
    },selectCoursesShow(id){
        return request({
            url:`/courseManagment/selectOne/${id}`,
            method:'get',
           
        })
    },deleteOneOrMore(ids){
        return request({
            url:`/courseManagment/deleteOne`,
            method:'get',
           data:{
               ids:[ids]
           }
        })
    },
    getPages(pageInfo,headlineShowQuery){
        return request({
            url:`/courseManagment/selectRecycleBin`,
            method:'post',
           data:{
                page:pageInfo.page,
                limit:pageInfo.limit,
                name:headlineShowQuery.name,
                upTime:headlineShowQuery.endTime,
                timeLimit:headlineShowQuery.startTime
            
           }
        })
    },recoverOne(id){
        return request({
            url:`/courseManagment/recoverOne/${id}`,
            method:'get'
           
        })
    },thoroughDelete(ids){
        return request({
            url:`/courseManagment/thoroughDelete`,
            method:'post',
           data:{
                ids:[ids]
           }
        })
    },updateCourse(addData){
        return request({
            url:`/courseManagment/updateOne`,
            method:'post',
           data:addData
        })
    },selectAllTeacherName(){
        return request({
            url:`/courseManagment/selectAllTeacher`,
            method:'post'
        })
    }
    // //添加教育头条
    // addHeadlineShow(HeadlineShow) {
    //     return request({
    //         url: `/headlineShow/addHeadlineShow`,
    //         method: 'post',
    //         data: HeadlineShow
    //     })
    // },
    // //根据id查询教育头条
    // getHeadlineShow(id) {
    //     return request({
    //         url: `/headlineShow/selectOne/${id}`,
    //         method: 'get'
    //     })
    // },
    // //修改教育头条
    // updateHeadlineShow(HeadlineShow) {
    //     return request({
    //         url: `/oss/fileUpload/${headlineShow.id}`,
    //         method: 'post',
    //         data: headlineShow
    //     })
    // }
}